import Vue from 'vue'
import App from './App.vue'
import router from './routers/index';
import store from '@/vuex/store';
import VueRouter from "vue-router";
import moment from 'moment';
import '@/assets/style/resets.css';
import 'element-ui/lib/theme-chalk/index.css';
import '@/assets/style/global.css';
import {Container,Header,Aside,Main,Form,FormItem,Input,Button,Row,Col,Radio,DatePicker,Message,Table,TableColumn,Image,Pagination} from 'element-ui';
import BreadCrumb from '@/components/commons/BreadCrumb.vue';
Vue.prototype.$message = Message; 
Vue.prototype.$moment = moment;
const originPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location,onResolve,onReject){
  if(onResolve || onReject) return originPush.call(this,location,onResolve,onReject)
  return originPush.call(this,location).catch(err=>err);
}
const originReplace = VueRouter.prototype.replace;
VueRouter.prototype.replace = function replace(location,onResolve,onReject){
  if(onResolve || onReject) return originReplace.call(this,location,onResolve,onReject)
  return originReplace.call(this,location).catch(err=>err);
}
Vue.config.productionTip = false
Vue.use(Container);
Vue.component(Header.name,Header);
Vue.use(Aside);
Vue.use(Main);
Vue.use(Form);
Vue.use(FormItem);
Vue.use(Input);
Vue.use(Button);
Vue.use(Row);
Vue.use(Col);
Vue.use(Radio);
Vue.use(DatePicker);
Vue.use(Table);
Vue.use(TableColumn);
Vue.use(Image);
Vue.use(Pagination);
Vue.component("BreadCrumb",BreadCrumb);
new Vue({
  store,
  router,
  render: h => h(App),
}).$mount('#app')
